package uk.co.nazz.f21mc_a2.ui;

import uk.co.nazz.f21mc_a2.DiaryApplication;
import uk.co.nazz.f21mc_a2.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements OnClickListener {

	Button btnNewEvent;
	Button btnViewEvents;
	DiaryApplication application;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		application = (DiaryApplication) this.getApplication();

		setContentView(R.layout.main);

		btnNewEvent = (Button) findViewById(R.id.btn_new_event);
		btnNewEvent.setOnClickListener(this);

		btnViewEvents = (Button) findViewById(R.id.btn_view_events);
		btnViewEvents.setOnClickListener(this);

	}
	
	@Override
	public void onClick(View view) {
		if (view == btnNewEvent) {
			Log.i("F21MC_2", "New event button clicked");
			startActivity(new Intent(this,
					uk.co.nazz.f21mc_a2.ui.EventEditor.class));
		} else if (view == btnViewEvents) {
			Log.i("F21MC_2", "View events button clicked");
			startActivity(new Intent(this,
					uk.co.nazz.f21mc_a2.ui.EventsList.class));
		}

	}
}
